package test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.util.Assert;

import com.zxw.springtest.login.impl.LoginImpl;

//@ContextConfiguration(locations={"WEB-INF/*.xml","classpath:conf/*.xml"})
//@RunWith(SpringJUnit4ClassRunner.class)

public class test {
//	@Autowired
//	private LoginDao dao;
	
	
//	@Autowired
//	private LoginService loginService;
//	@Test
	public void testLoginImpl(){		
		
		String path=Thread.currentThread().getContextClassLoader().getResource("").toString();
		System.out.println(path);
	
//		ApplicationContext  context=new FileSystemXmlApplicationContext("");
//		int i = dao.login("admin","admin");
//		loginService.login("", "");
	}
	
	public static void main(String[] args) {
//		String path=Thread.currentThread().getContextClassLoader().getResource("").toString();
		//D:\workspace-sts-3.7.0.RELEASE\mavenSpringMVCTest\src\main\webapp\WEB-INF\dispatcher-servlet.xml
		ApplicationContext  context=new FileSystemXmlApplicationContext("D:\\workspace-sts-3.7.0.RELEASE\\mavenSpringMVCTest\\src\\main\\webapp\\WEB-INF\\dispatcher-servlet.xml","classpath:conf/*.xml");
		Assert.notNull(context);
		LoginImpl logservice=(LoginImpl)context.getBean(LoginImpl.class);
		logservice.login(null, null);
	}
}
